<?php echo $this->Html->script('Events/get_futbol_data_repositorie_matchs');?>
<div class='span10'>
    <?php
        if(count($data) <= 0)
        echo "No hay encuentros en la fecha seleccionada"; 
        else
        {
        ?>
        <table class="table table-bordered">
                    <thead>
                                <tr>
                                        <th></th>
                                        <th>Local</th>
                                        <th>Visitante</th>
                                        <th>Día</th>
                                        <th>Hora</th>
                                        <th>Estado</th>
                                        <th>Código</th>
                                </tr>
                    </thead>
                    <tbody>
                    <?php foreach($data as $field):?>	<a 			
                    <tr>
                        <td style="text-align: center;">
                            <?php echo '<a onClick="get_fields_by_match(\''.$field['TurnamentMatchs']['matchid'].'\',
                                                                        \''.$field['TurnamentMatchs']['localteamname'].'\',
                                                                        \''.$field['TurnamentMatchs']['visitteamname'].'\')
                                                                        "><i class="icon-plus-sign"></i></a>';?></td>
                        <td><?php echo $field['TurnamentMatchs']['localteamname']?></td>
                        <td><?php echo $field['TurnamentMatchs']['visitteamname']?></td>
                        <td><?php echo $field['TurnamentMatchs']['date']?></td>
                        <td><?php echo $field['TurnamentMatchs']['time']?></td>
                        <td><?php echo $field['TurnamentMatchs']['status']?></td>
                        <td><?php echo $field['TurnamentMatchs']['matchid']?></td>
                    </tr>
                    <?php endforeach;?>
                    </tbody>
        </table>
        <?php
        }
        ?>
</div>

<input type="hidden" id="input_matchId">
<div class="modal hide fade" id="dinamic_fields">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3><div id="event_name"></div></h3>
  </div>
  <div class="modal-body">
    <table width="100%">
        <tr>
            <td width="30%">
                Nombre del evento
            </td>
            <td width="70%">
                <input type="text" id="event_name_input">
                <!--<a href="#" data-toggle="tooltip" id="test" title="El nombre del evento puede ser modificado." style="margin-left: 10px;">-->
                    <i class="icon-info-sign" style="margin-left: 10px;"></i>
                <!--</a>-->
            </td>
        </tr>
        <tr>
            <td colspan="2"><h4>Información adicional</h4></td>
        </tr>
        <tr>
            <td colspan="2"><div id="aditional_fields_container"></div></td>
        </tr>
    </table>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary" onclick="acept()">Save</a>
  </div>
</div>